import instance from '@/http/index.js'

//注册接口
export const register = (data) => {
    const { account, password } = data
    // return instance.post('/api/register', { account, password });
    return instance({
        url: '/api/register',
        method: 'post',
        data: {
            account,
            password
        }
    })
}
//登录接口
export const login = (data) => {
    const { account, password } = data
    return instance.post('/api/login', { account, password });
}
//忘记密码接口：验证账号和邮箱是否匹配
export const verify = (data) => {
    const { account, email } = data
    return instance.post('/user/verifyAccountAndEmail', { account, email });
}

//忘记密码接口：更新密码
export const resetPassword = (id,newPassword) => {
    return instance.post('/user/changePasswordInLogin', { id, newPassword });
}